package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售实体类
 */
@TableName("t_sell")
public class SellBean {
    //    销售编号
    @TableId(value = "pk_sellId", type = IdType.AUTO)
    private Integer id;

    //    销售员
    @TableField("s_user")
    private String user;

    //    销售时间
    @TableField("s_date")
    private LocalDate date = LocalDate.now();

    //    地址
    @TableField("s_address")
    private String address;

    //    销售明细集合
    @TableField(exist = false)
    private List<SellInfoBean> sellInfo;

    //    销售总金额
    @TableField("s_allMoney")
    private Integer allMoney;

    //    所属客户
    @TableField(exist = false)
    private ClientBean client;

    //    所属客户id
    @TableField("fk_clientId")
    private Integer clientId;

    public SellBean() {
    }

    public SellBean(String user, LocalDate date, String address,
                    Integer allMoney, Integer clientId) {
        this.user = user;
        this.date = date;
        this.address = address;
        this.allMoney = allMoney;
        this.clientId = clientId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public List<SellInfoBean> getSellInfo() {
        return sellInfo;
    }

    public void setSellInfo(List<SellInfoBean> sellInfo) {
        this.sellInfo = sellInfo;
    }

    public Integer getAllMoney() {
        return allMoney;
    }

    public void setAllMoney(Integer allMoney) {
        this.allMoney = allMoney;
    }

    public ClientBean getClient() {
        return client;
    }

    public void setClient(ClientBean client) {
        this.client = client;
    }

    public Integer getClientId() {
        return clientId;
    }

    public void setClientId(Integer clientId) {
        this.clientId = clientId;
    }

    @Override
    public String toString() {
        return "SellBean{" +
                "id=" + id +
                ", user='" + user + '\'' +
                ", date=" + date +
                ", address='" + address + '\'' +
                ", sellInfo=" + sellInfo +
                ", sellMoney=" + allMoney +
                ", client=" + client +
                ", clientId=" + clientId +
                '}';
    }
}
